#include "ackerman.h"
#include "math.h"
#include "my_allocator.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> 





int main(int argc, char ** argv) 
{

	int c;
	unsigned int basicSize;
	unsigned int length;
	int digit_optind = 0;
	int aopt = 0, bopt = 0;
   	char *copt = 0, *dopt = 0;
	  while ( (c = getopt(argc, argv, "b::s::")) != -1) 
	  {
			int this_option_optind = optind ? optind : 1;
			switch (c) 
 			{
		
			case 'b':
				printf("Option b with value '%s'\n", optarg);
				dopt = optarg;
				basicSize = atoi(optarg);
				printf("basicSize = %d\n", basicSize);
				break;
			
			case 's':
				printf("Option s with value '%s'\n", optarg);
				dopt = optarg;
				length = atoi(optarg);
				printf("length = %d\n", length);
				break;
			
			default:
				printf("getopt returned something unexpected\n", c);
			}
           }

		if (optind < argc) 
		{
			printf ("Non-option ARGV-elements: ");
			while (optind < argc)
				printf("%s ", argv[optind++]);
			printf("\n");
		}
	
	if(init_allocator(basicSize, length) == 0)
	{
		printf("Error: init_allocator failed\n");
		return -1;
	}
	
	//ackerman_main();
	int*temp=my_malloc(4);
	
	release_allocator();

	return 0;
}
